package cn.com.ejiakanghu.vo;

import cn.com.ejiakanghu.core.utils.LngLatUtil;
import org.linlinjava.litemall.db.domain.AgedmallStore;

import java.math.BigDecimal;

public class StoreInfoVo {
    private Integer id;
    private String name;
    private Integer storeId;
    private String province;
    private String city;
    private String village;
    private String userName;
    private String phone;
    private String address;
    private String detail;
    private String businessTime;
    private BigDecimal lng;
    private BigDecimal lat;
    private Integer stock;

    public static StoreInfoVo getInstance(AgedmallStore store) {
        StoreInfoVo storeInfoVo = new StoreInfoVo();
        if(store == null) {
            return storeInfoVo;
        }
        storeInfoVo.setId(store.getId().intValue());
        storeInfoVo.setName(store.getStoreName());
        storeInfoVo.setStoreId(store.getBusiId());
        storeInfoVo.setProvince(store.getProvinceName());
        storeInfoVo.setCity(store.getCityName());
        storeInfoVo.setVillage(store.getAreaName());
        storeInfoVo.setUserName(store.getUserName());
        storeInfoVo.setPhone(store.getPhone());
        storeInfoVo.setAddress(store.getAddressDetail());
        storeInfoVo.setDetail(store.getProvinceName() + store.getCityName() + store.getAreaName() + store.getAddressDetail());
        String workWeek = "";
        if (null != store.getWorkWeek() && store.getWorkWeek() == 0) {
            workWeek = "周一到周五";
        }
        if (null != store.getWorkWeek() && store.getWorkWeek() == 1) {
            workWeek = "周一到周六";
        }
        if (null != store.getWorkWeek() && store.getWorkWeek() == 2) {
            workWeek = "周一到周日";
        }
        storeInfoVo.setBusinessTime(workWeek + " " + store.getBusinessTime());
        storeInfoVo.setLng(store.getLng());
        storeInfoVo.setLat(store.getLat());
        return storeInfoVo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStoreId() {
        return storeId;
    }

    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getVillage() {
        return village;
    }

    public void setVillage(String village) {
        this.village = village;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getBusinessTime() {
        return businessTime;
    }

    public void setBusinessTime(String businessTime) {
        this.businessTime = businessTime;
    }

    public BigDecimal getLng() {
        return lng;
    }

    public void setLng(BigDecimal lng) {
        this.lng = lng;
    }

    public BigDecimal getLat() {
        return lat;
    }

    public void setLat(BigDecimal lat) {
        this.lat = lat;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }
}
